/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package percussiongenerator.commands;

import percussiongenerator.model.Track;
import percussiongenerator.model.TrackCollection;

/**
 *
 * @author Jannes Plyson
 */
public class RemoveTrack implements ICommand{
    private Track track;
    private TrackCollection trackCollection;

    public RemoveTrack(Track track){
        this.track = track;
        this.trackCollection = track.getTrackCollection();
    }

    public void execute() {
        track.removeFromCollection();
    }

    public void undo() {
        trackCollection.addTrack(track);
    }

}
